package org.jod.anarchytrek.universe;

import org.jod.anarchytrek.IMapSystem;

public class SpaceSystem  implements IMapSystem {

	public static String TILES_TYPE = "0";

	protected String[][] _map = null;

	private int _x;

	private int _y;

	public SpaceSystem(int x, int y) {
		_x= x;
		_y = y;
		_map = new String[x][y];
	}

	public boolean blocked(int x, int y) {
		return false;
	}
	
	public void set(int x, int y, String tilesType) {
		_map[x][y] = tilesType;
	}
	
	public void generate() {
		for (int y= 0 ; y < _y ; y++) {
			for (int x = 0; x < _x ; x++) {
				set(x,y,TILES_TYPE);
			}
		}		
	}
	


	public String points() {
		StringBuffer points = new StringBuffer();
		for (int y= 0 ; y < _y ; y++) {
			for (int x = 0; x < _x ; x++) {
				points.append( _map[x][y] ); 
			}
		}		
		return points.toString();
	}
	
	public String toString() {
		StringBuffer points = new StringBuffer();
		for (int y= 0 ; y < _y ; y++) {
			for (int x = 0; x < _x ; x++) {
				points.append( _map[x][y] ); 
			}
			points.append("\r\n");
		}
		return points.toString();
	}
	
	public int height() {
		return _x;
	}

	public int width() {
		return _y;
	}

	public int size() {
		return _x*_y;
	}
}
